package SparkRDD.RDD算子.Actions

import org.apache.spark.{SparkConf, SparkContext}
import org.junit.Test

class numberTest {

  val conf = new SparkConf().setMaster("local[6]").setAppName("sortBy")
  val sc   = new SparkContext(conf)

  @Test
  def numberTest: Unit ={
    val rdd = sc.parallelize(Seq(1,2,3,4,5,6))
    println(rdd.count()) //个数
    println(rdd.mean())  //均值
    println(rdd.sum())   //和
    println(rdd.max())   //最大、最小
    println(rdd.min())
    println(rdd.variance()) //方差
    println(rdd.stdev()) //标准差
  }
}
